home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / Power.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  25.6 KB  |  683 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Power.h
  3.  
  4.      Contains:    Power Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1990-1997 by Apple Computer, Inc.  All rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __POWER__
  19. #define __POWER__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __MIXEDMODE__
  25. #include <MixedMode.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50.  
  51. enum {
  52.                                                                 /* Bit positions for ModemByte */
  53.     modemOnBit                    = 0,
  54.     ringWakeUpBit                = 2,
  55.     modemInstalledBit            = 3,
  56.     ringDetectBit                = 4,
  57.     modemOnHookBit                = 5
  58. };
  59.  
  60.  
  61. enum {
  62.                                                                 /* masks for ModemByte */
  63.     modemOnMask                    = 0x01,
  64.     ringWakeUpMask                = 0x04,
  65.     modemInstalledMask            = 0x08,
  66.     ringDetectMask                = 0x10,
  67.     modemOnHookMask                = 0x20
  68. };
  69.  
  70.  
  71. enum {
  72.                                                                 /* bit positions for BatteryByte */
  73.     chargerConnBit                = 0,
  74.     hiChargeBit                    = 1,
  75.     chargeOverFlowBit            = 2,
  76.     batteryDeadBit                = 3,
  77.     batteryLowBit                = 4,
  78.     connChangedBit                = 5
  79. };
  80.  
  81.  
  82. enum {
  83.                                                                 /* masks for BatteryByte */
  84.     chargerConnMask                = 0x01,
  85.     hiChargeMask                = 0x02,
  86.     chargeOverFlowMask            = 0x04,
  87.     batteryDeadMask                = 0x08,
  88.     batteryLowMask                = 0x10,
  89.     connChangedMask                = 0x20
  90. };
  91.  
  92.  
  93. enum {
  94.                                                                 /* bit positions for SoundMixerByte */
  95.     MediaBaySndEnBit            = 0,
  96.     PCISndEnBit                    = 1,
  97.     ZVSndEnBit                    = 2,
  98.     PCCardSndEnBit                = 3
  99. };
  100.  
  101.  
  102. enum {
  103.                                                                 /* masks for SoundMixerByte */
  104.     MediaBaySndEnMask            = 0x01,
  105.     PCISndEnMask                = 0x02,
  106.     ZVSndEnMask                    = 0x04,
  107.     PCCardSndEnMask                = 0x08
  108. };
  109.  
  110.  
  111. enum {
  112.                                                                 /* commands to SleepQRec sleepQProc */
  113.     sleepRequest                = 1,
  114.     sleepDemand                    = 2,
  115.     sleepWakeUp                    = 3,
  116.     sleepRevoke                    = 4,
  117.     sleepUnlock                    = 4,
  118.     sleepDeny                    = 5,
  119.     sleepNow                    = 6,
  120.     dozeDemand                    = 7,
  121.     dozeWakeUp                    = 8,
  122.     dozeRequest                    = 9
  123. };
  124.  
  125.  
  126. enum {
  127.                                                                 /* SleepQRec.sleepQFlags */
  128.     noCalls                        = 1,
  129.     noRequest                    = 2,
  130.     slpQType                    = 16,
  131.     sleepQType                    = 16
  132. };
  133.  
  134. /* bits in bitfield returned by PMFeatures */
  135.  
  136. enum {
  137.     hasWakeupTimer                = 0,                            /* 1=wakeup timer is supported                                */
  138.     hasSharedModemPort            = 1,                            /* 1=modem port shared by SCC and internal modem            */
  139.     hasProcessorCycling            = 2,                            /* 1=processor cycling is supported                            */
  140.     mustProcessorCycle            = 3,                            /* 1=processor cycling should not be turned off                */
  141.     hasReducedSpeed                = 4,                            /* 1=processor can be started up at reduced speed            */
  142.     dynamicSpeedChange            = 5,                            /* 1=processor speed can be switched dynamically            */
  143.     hasSCSIDiskMode                = 6,                            /* 1=SCSI Disk Mode is supported                            */
  144.     canGetBatteryTime            = 7,                            /* 1=battery time can be calculated                            */
  145.     canWakeupOnRing                = 8,                            /* 1=can wakeup when the modem detects a ring                */
  146.     hasDimmingSupport            = 9,                            /* 1=has dimming support built in (DPMS standby by default)    */
  147.     hasStartupTimer                = 10,                            /* 1=startup timer is supported                                */
  148.     hasChargeNotification        = 11,                            /* 1=client can determine of charge connect status change notifications available */
  149.     hasDimSuspendSupport        = 12                            /* 1=supports dimming LCD and CRT to DPMS suspend state        */
  150. };
  151.  
  152. /* bits in bitfield returned by GetIntModemInfo and set by SetIntModemState */
  153.  
  154. enum {
  155.     hasInternalModem            = 0,                            /* 1=internal modem installed                        */
  156.     intModemRingDetect            = 1,                            /* 1=internal modem has detected a ring                */
  157.     intModemOffHook                = 2,                            /* 1=internal modem is off hook                        */
  158.     intModemRingWakeEnb            = 3,                            /* 1=wakeup on ring is enabled                        */
  159.     extModemSelected            = 4,                            /* 1=external modem selected                        */
  160.     modemSetBit                    = 15                            /* 1=set bit, 0=clear bit (SetIntModemState)        */
  161. };
  162.  
  163. /* bits in BatteryInfo.flags                                     */
  164. /* ("chargerConnected" doesn't mean the charger is plugged in)    */
  165.  
  166. enum {
  167.     batteryInstalled            = 7,                            /* 1=battery is currently connected                    */
  168.     batteryCharging                = 6,                            /* 1=battery is being charged                        */
  169.     chargerConnected            = 5                                /* 1=charger is connected to the PowerBook            */
  170. };
  171.  
  172.  
  173. enum {
  174.     HDPwrQType                    = 0x4844,                        /* 'HD' hard disk spindown queue element type        */
  175.     PMgrStateQType                = 0x504D                        /* 'PM' Power Manager state queue element type        */
  176. };
  177.  
  178. /* client notification bits in PMgrQueueElement.pmNotifyBits */
  179.  
  180. enum {
  181.     pmSleepTimeoutChanged        = 0,
  182.     pmSleepEnableChanged        = 1,
  183.     pmHardDiskTimeoutChanged    = 2,
  184.     pmHardDiskSpindownChanged    = 3,
  185.     pmDimmingTimeoutChanged        = 4,
  186.     pmDimmingEnableChanged        = 5,
  187.     pmDiskModeAddressChanged    = 6,
  188.     pmProcessorCyclingChanged    = 7,
  189.     pmProcessorSpeedChanged        = 8,
  190.     pmWakeupTimerChanged        = 9,
  191.     pmStartupTimerChanged        = 10,
  192.     pmHardDiskPowerRemovedbyUser = 11,
  193.     pmChargeStatusChanged        = 12
  194. };
  195.  
  196. /* System Activity Selectors */
  197.  
  198. enum {
  199.     OverallAct                    = 0,                            /* general type of activity                            */
  200.     UsrActivity                    = 1,                            /* user specific type of activity                    */
  201.     NetActivity                    = 2,                            /* network specific activity                        */
  202.     HDActivity                    = 3                                /* Hard Drive activity                                */
  203. };
  204.  
  205. /* Storage Media sleep mode defines */
  206.  
  207. enum {
  208.     kMediaModeOn                = 0,                            /* Media active (Drive spinning and at full power)    */
  209.     kMediaModeStandBy            = 1,                            /* Media standby (not implemented)    */
  210.     kMediaModeSuspend            = 2,                            /* Media Idle (not implemented)    */
  211.     kMediaModeOff                = 3                                /* Media Sleep (Drive not spinning and at min power, max recovery time)    */
  212. };
  213.  
  214.  
  215. enum {
  216.     kMediaPowerCSCode            = 70
  217. };
  218.  
  219.  
  220. /* definitions for HDQueueElement.hdFlags    */
  221.  
  222. enum {
  223.     kHDQueuePostBit                = 0,                            /* 1 = call this routine on the second pass        */
  224.     kHDQueuePostMask            = (1 << kHDQueuePostBit)
  225. };
  226.  
  227. struct ActivityInfo {
  228.     short                             ActivityType;                /* Type of activity to be fetched.  Same as UpdateSystemActivity Selectors */
  229.     unsigned long                     ActivityTime;                /* Time of last activity (in ticks) of specified type. */
  230. };
  231. typedef struct ActivityInfo ActivityInfo;
  232.  
  233. /* information returned by GetScaledBatteryInfo */
  234. struct BatteryInfo {
  235.     UInt8                             flags;                        /* misc flags (see below)                            */
  236.     UInt8                             warningLevel;                /* scaled warning level (0-255)                        */
  237.     UInt8                             reserved;                    /* reserved for internal use                        */
  238.     UInt8                             batteryLevel;                /* scaled battery level (0-255)                        */
  239. };
  240. typedef struct BatteryInfo BatteryInfo;
  241.  
  242. typedef SInt8                             ModemByte;
  243. typedef SInt8                             BatteryByte;
  244. typedef SInt8                             SoundMixerByte;
  245. typedef long                             PMResultCode;
  246. typedef struct SleepQRec                 SleepQRec;
  247. typedef SleepQRec *                        SleepQRecPtr;
  248. typedef struct HDQueueElement             HDQueueElement;
  249. typedef struct PMgrQueueElement         PMgrQueueElement;
  250. typedef CALLBACK_API( long , SleepQProcPtr )(long message, SleepQRecPtr qRecPtr);
  251. /*
  252.     WARNING: SleepQProcPtr uses register based parameters under classic 68k
  253.              and cannot be written in a high-level language without 
  254.              the help of mixed mode or assembly glue.
  255. */
  256. typedef CALLBACK_API( void , HDSpindownProcPtr )(HDQueueElement *theElement);
  257. typedef CALLBACK_API( void , PMgrStateChangeProcPtr )(PMgrQueueElement *theElement, long stateBits);
  258. typedef REGISTER_UPP_TYPE(SleepQProcPtr)                         SleepQUPP;
  259. typedef STACK_UPP_TYPE(HDSpindownProcPtr)                         HDSpindownUPP;
  260. typedef STACK_UPP_TYPE(PMgrStateChangeProcPtr)                     PMgrStateChangeUPP;
  261. struct SleepQRec {
  262.     SleepQRecPtr                     sleepQLink;                    /* pointer to next queue element                */
  263.     short                             sleepQType;                    /* queue element type (must be SleepQType)        */
  264.     SleepQUPP                         sleepQProc;                    /* pointer to sleep universal proc ptr            */
  265.     short                             sleepQFlags;                /* flags                                        */
  266. };
  267.  
  268. struct HDQueueElement {
  269.     struct HDQueueElement *            hdQLink;                    /* pointer to next queue element                */
  270.     short                             hdQType;                    /* queue element type (must be HDPwrQType)        */
  271.     short                             hdFlags;                    /* miscellaneous flags                            */
  272.     HDSpindownUPP                     hdProc;                        /* pointer to routine to call                    */
  273.     long                             hdUser;                        /* user-defined (variable storage, etc.)        */
  274. };
  275.  
  276. struct PMgrQueueElement {
  277.     struct PMgrQueueElement *        pmQLink;                    /* pointer to next queue element                */
  278.     short                             pmQType;                    /* queue element type (must be PMgrStateQType)    */
  279.     short                             pmFlags;                    /* miscellaneous flags                            */
  280.     long                             pmNotifyBits;                /* bitmap of which changes to be notified for    */
  281.     PMgrStateChangeUPP                 pmProc;                        /* pointer to routine to call                    */
  282.     long                             pmUser;                        /* user-defined (variable storage, etc.)        */
  283. };
  284.  
  285.  
  286. struct BatteryTimeRec {
  287.     unsigned long                     expectedBatteryTime;        /* estimated battery time remaining (seconds)    */
  288.     unsigned long                     minimumBatteryTime;            /* minimum battery time remaining (seconds)        */
  289.     unsigned long                     maximumBatteryTime;            /* maximum battery time remaining (seconds)        */
  290.     unsigned long                     timeUntilCharged;            /* time until battery is fully charged (seconds)*/
  291. };
  292. typedef struct BatteryTimeRec BatteryTimeRec;
  293.  
  294.  
  295. struct WakeupTime {
  296.     unsigned long                     wakeTime;                    /* wakeup time (same format as current time)        */
  297.     Boolean                         wakeEnabled;                /* 1=enable wakeup timer, 0=disable wakeup timer    */
  298.     SInt8                             filler;
  299. };
  300. typedef struct WakeupTime WakeupTime;
  301.  
  302.  
  303. struct StartupTime {
  304.     unsigned long                     startTime;                    /* startup time (same format as current time)        */
  305.     Boolean                         startEnabled;                /* 1=enable startup timer, 0=disable startup timer    */
  306.     SInt8                             filler;
  307. };
  308. typedef struct StartupTime StartupTime;
  309.  
  310. EXTERN_API( OSErr )
  311. DisableWUTime                    (void);
  312.  
  313. EXTERN_API( OSErr )
  314. SetWUTime                        (long                     WUTime);
  315.  
  316. EXTERN_API( OSErr )
  317. GetWUTime                        (long *                    WUTime,
  318.                                  Byte *                    WUFlag);
  319.  
  320. EXTERN_API( OSErr )
  321. BatteryStatus                    (Byte *                    Status,
  322.                                  Byte *                    Power);
  323.  
  324. EXTERN_API( OSErr )
  325. ModemStatus                        (Byte *                    Status);
  326.  
  327.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  328.                                                                                             #pragma parameter __D0 IdleUpdate
  329.                                                                                             #endif
  330. EXTERN_API( long )
  331. IdleUpdate                        (void)                                                        ONEWORDINLINE(0xA285);
  332.  
  333.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  334.                                                                                             #pragma parameter __D0 GetCPUSpeed
  335.                                                                                             #endif
  336. EXTERN_API( long )
  337. GetCPUSpeed                        (void)                                                        TWOWORDINLINE(0x70FF, 0xA485);
  338.  
  339. EXTERN_API( void )
  340. EnableIdle                        (void)                                                        TWOWORDINLINE(0x7000, 0xA485);
  341.  
  342. EXTERN_API( void )
  343. DisableIdle                        (void)                                                        TWOWORDINLINE(0x7001, 0xA485);
  344.  
  345.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  346.                                                                                             #pragma parameter SleepQInstall(__A0)
  347.                                                                                             #endif
  348. EXTERN_API( void )
  349. SleepQInstall                    (SleepQRecPtr             qRecPtr)                            ONEWORDINLINE(0xA28A);
  350.  
  351.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  352.                                                                                             #pragma parameter SleepQRemove(__A0)
  353.                                                                                             #endif
  354. EXTERN_API( void )
  355. SleepQRemove                    (SleepQRecPtr             qRecPtr)                            ONEWORDINLINE(0xA48A);
  356.  
  357. EXTERN_API( void )
  358. AOn                                (void)                                                        TWOWORDINLINE(0x7004, 0xA685);
  359.  
  360. EXTERN_API( void )
  361. AOnIgnoreModem                    (void)                                                        TWOWORDINLINE(0x7005, 0xA685);
  362.  
  363. EXTERN_API( void )
  364. BOn                                (void)                                                        TWOWORDINLINE(0x7000, 0xA685);
  365.  
  366. EXTERN_API( void )
  367. AOff                            (void)                                                        TWOWORDINLINE(0x7084, 0xA685);
  368.  
  369. EXTERN_API( void )
  370. BOff                            (void)                                                        TWOWORDINLINE(0x7080, 0xA685);
  371.  
  372.  
  373. /* Public Power Management API (NEW!) */
  374.  
  375.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  376.                                                                                             #pragma parameter __D0 PMSelectorCount
  377.                                                                                             #endif
  378. EXTERN_API( short )
  379. PMSelectorCount                    (void)                                                        TWOWORDINLINE(0x7000, 0xA09E);
  380.  
  381.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  382.                                                                                             #pragma parameter __D0 PMFeatures
  383.                                                                                             #endif
  384. EXTERN_API( unsigned long )
  385. PMFeatures                        (void)                                                        TWOWORDINLINE(0x7001, 0xA09E);
  386.  
  387.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  388.                                                                                             #pragma parameter __D0 GetSleepTimeout
  389.                                                                                             #endif
  390. EXTERN_API( UInt8 )
  391. GetSleepTimeout                    (void)                                                        TWOWORDINLINE(0x7002, 0xA09E);
  392.  
  393.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  394.                                                                                             #pragma parameter SetSleepTimeout(__D0)
  395.                                                                                             #endif
  396. EXTERN_API( void )
  397. SetSleepTimeout                    (UInt8                     timeout)                            FOURWORDINLINE(0x4840, 0x303C, 0x0003, 0xA09E);
  398.  
  399.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  400.                                                                                             #pragma parameter __D0 GetHardDiskTimeout
  401.                                                                                             #endif
  402. EXTERN_API( UInt8 )
  403. GetHardDiskTimeout                (void)                                                        TWOWORDINLINE(0x7004, 0xA09E);
  404.  
  405.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  406.                                                                                             #pragma parameter SetHardDiskTimeout(__D0)
  407.                                                                                             #endif
  408. EXTERN_API( void )
  409. SetHardDiskTimeout                (UInt8                     timeout)                            FOURWORDINLINE(0x4840, 0x303C, 0x0005, 0xA09E);
  410.  
  411.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  412.                                                                                             #pragma parameter __D0 HardDiskPowered
  413.                                                                                             #endif
  414. EXTERN_API( Boolean )
  415. HardDiskPowered                    (void)                                                        TWOWORDINLINE(0x7006, 0xA09E);
  416.  
  417.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  418.                                                                                             #pragma parameter SpinDownHardDisk
  419.                                                                                             #endif
  420. EXTERN_API( void )
  421. SpinDownHardDisk                (void)                                                        TWOWORDINLINE(0x7007, 0xA09E);
  422.  
  423.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  424.                                                                                             #pragma parameter __D0 IsSpindownDisabled
  425.                                                                                             #endif
  426. EXTERN_API( Boolean )
  427. IsSpindownDisabled                (void)                                                        TWOWORDINLINE(0x7008, 0xA09E);
  428.  
  429.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  430.                                                                                             #pragma parameter SetSpindownDisable(__D0)
  431.                                                                                             #endif
  432. EXTERN_API( void )
  433. SetSpindownDisable                (Boolean                 setDisable)                            FOURWORDINLINE(0x4840, 0x303C, 0x0009, 0xA09E);
  434.  
  435.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  436.                                                                                             #pragma parameter __D0 HardDiskQInstall(__A0)
  437.                                                                                             #endif
  438. EXTERN_API( OSErr )
  439. HardDiskQInstall                (HDQueueElement *        theElement)                            TWOWORDINLINE(0x700A, 0xA09E);
  440.  
  441.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  442.                                                                                             #pragma parameter __D0 HardDiskQRemove(__A0)
  443.                                                                                             #endif
  444. EXTERN_API( OSErr )
  445. HardDiskQRemove                    (HDQueueElement *        theElement)                            TWOWORDINLINE(0x700B, 0xA09E);
  446.  
  447.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  448.                                                                                             #pragma parameter GetScaledBatteryInfo(__D0, __A0)
  449.                                                                                             #endif
  450. EXTERN_API( void )
  451. GetScaledBatteryInfo            (short                     whichBattery,
  452.                                  BatteryInfo *            theInfo)                            FIVEWORDINLINE(0x4840, 0x303C, 0x000C, 0xA09E, 0x2080);
  453.  
  454.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  455.                                                                                             #pragma parameter AutoSleepControl(__D0)
  456.                                                                                             #endif
  457. EXTERN_API( void )
  458. AutoSleepControl                (Boolean                 enableSleep)                        FOURWORDINLINE(0x4840, 0x303C, 0x000D, 0xA09E);
  459.  
  460.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  461.                                                                                             #pragma parameter __D0 GetIntModemInfo
  462.                                                                                             #endif
  463. EXTERN_API( unsigned long )
  464. GetIntModemInfo                    (void)                                                        TWOWORDINLINE(0x700E, 0xA09E);
  465.  
  466.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  467.                                                                                             #pragma parameter SetIntModemState(__D0)
  468.                                                                                             #endif
  469. EXTERN_API( void )
  470. SetIntModemState                (short                     theState)                            FOURWORDINLINE(0x4840, 0x303C, 0x000F, 0xA09E);
  471.  
  472.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  473.                                                                                             #pragma parameter __D0 MaximumProcessorSpeed
  474.                                                                                             #endif
  475. EXTERN_API( short )
  476. MaximumProcessorSpeed            (void)                                                        TWOWORDINLINE(0x7010, 0xA09E);
  477.  
  478.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  479.                                                                                             #pragma parameter __D0 CurrentProcessorSpeed
  480.                                                                                             #endif
  481. EXTERN_API( short )
  482. CurrentProcessorSpeed            (void)                                                        TWOWORDINLINE(0x7011, 0xA09E);
  483.  
  484.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  485.                                                                                             #pragma parameter __D0 FullProcessorSpeed
  486.                                                                                             #endif
  487. EXTERN_API( Boolean )
  488. FullProcessorSpeed                (void)                                                        TWOWORDINLINE(0x7012, 0xA09E);
  489.  
  490.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  491.                                                                                             #pragma parameter __D0 SetProcessorSpeed(__D0)
  492.                                                                                             #endif
  493. EXTERN_API( Boolean )
  494. SetProcessorSpeed                (Boolean                 fullSpeed)                            FOURWORDINLINE(0x4840, 0x303C, 0x0013, 0xA09E);
  495.  
  496.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  497.                                                                                             #pragma parameter __D0 GetSCSIDiskModeAddress
  498.                                                                                             #endif
  499. EXTERN_API( short )
  500. GetSCSIDiskModeAddress            (void)                                                        TWOWORDINLINE(0x7014, 0xA09E);
  501.  
  502.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  503.                                                                                             #pragma parameter SetSCSIDiskModeAddress(__D0)
  504.                                                                                             #endif
  505. EXTERN_API( void )
  506. SetSCSIDiskModeAddress            (short                     scsiAddress)                        FOURWORDINLINE(0x4840, 0x303C, 0x0015, 0xA09E);
  507.  
  508.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  509.                                                                                             #pragma parameter GetWakeupTimer(__A0)
  510.                                                                                             #endif
  511. EXTERN_API( void )
  512. GetWakeupTimer                    (WakeupTime *            theTime)                            TWOWORDINLINE(0x7016, 0xA09E);
  513.  
  514.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  515.                                                                                             #pragma parameter SetWakeupTimer(__A0)
  516.                                                                                             #endif
  517. EXTERN_API( void )
  518. SetWakeupTimer                    (WakeupTime *            theTime)                            TWOWORDINLINE(0x7017, 0xA09E);
  519.  
  520.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  521.                                                                                             #pragma parameter __D0 IsProcessorCyclingEnabled
  522.                                                                                             #endif
  523. EXTERN_API( Boolean )
  524. IsProcessorCyclingEnabled        (void)                                                        TWOWORDINLINE(0x7018, 0xA09E);
  525.  
  526.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  527.                                                                                             #pragma parameter EnableProcessorCycling(__D0)
  528.                                                                                             #endif
  529. EXTERN_API( void )
  530. EnableProcessorCycling            (Boolean                 enable)                                FOURWORDINLINE(0x4840, 0x303C, 0x0019, 0xA09E);
  531.  
  532.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  533.                                                                                             #pragma parameter __D0 BatteryCount
  534.                                                                                             #endif
  535. EXTERN_API( short )
  536. BatteryCount                    (void)                                                        TWOWORDINLINE(0x701A, 0xA09E);
  537.  
  538.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  539.                                                                                             #pragma parameter __D0 GetBatteryVoltage(__D0)
  540.                                                                                             #endif
  541. EXTERN_API( Fixed )
  542. GetBatteryVoltage                (short                     whichBattery)                        FOURWORDINLINE(0x4840, 0x303C, 0x001B, 0xA09E);
  543.  
  544.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  545.                                                                                             #pragma parameter GetBatteryTimes(__D0, __A0)
  546.                                                                                             #endif
  547. EXTERN_API( void )
  548. GetBatteryTimes                    (short                     whichBattery,
  549.                                  BatteryTimeRec *        theTimes)                            FOURWORDINLINE(0x4840, 0x303C, 0x001C, 0xA09E);
  550.  
  551.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  552.                                                                                             #pragma parameter __D0 GetDimmingTimeout
  553.                                                                                             #endif
  554. EXTERN_API( UInt8 )
  555. GetDimmingTimeout                (void)                                                        TWOWORDINLINE(0x701D, 0xA09E);
  556.  
  557.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  558.                                                                                             #pragma parameter SetDimmingTimeout(__D0)
  559.                                                                                             #endif
  560. EXTERN_API( void )
  561. SetDimmingTimeout                (UInt8                     timeout)                            FOURWORDINLINE(0x4840, 0x303C, 0x001E, 0xA09E);
  562.  
  563.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  564.                                                                                             #pragma parameter DimmingControl(__D0)
  565.                                                                                             #endif
  566. EXTERN_API( void )
  567. DimmingControl                    (Boolean                 enableSleep)                        FOURWORDINLINE(0x4840, 0x303C, 0x001F, 0xA09E);
  568.  
  569.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  570.                                                                                             #pragma parameter __D0 IsDimmingControlDisabled
  571.                                                                                             #endif
  572. EXTERN_API( Boolean )
  573. IsDimmingControlDisabled        (void)                                                        TWOWORDINLINE(0x7020, 0xA09E);
  574.  
  575.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  576.                                                                                             #pragma parameter __D0 IsAutoSlpControlDisabled
  577.                                                                                             #endif
  578. EXTERN_API( Boolean )
  579. IsAutoSlpControlDisabled        (void)                                                        TWOWORDINLINE(0x7021, 0xA09E);
  580.  
  581.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  582.                                                                                             #pragma parameter __D0 PMgrStateQInstall(__A0)
  583.                                                                                             #endif
  584. EXTERN_API( OSErr )
  585. PMgrStateQInstall                (PMgrQueueElement *        theElement)                            TWOWORDINLINE(0x7022, 0xA09E);
  586.  
  587.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  588.                                                                                             #pragma parameter __D0 PMgrStateQRemove(__A0)
  589.                                                                                             #endif
  590. EXTERN_API( OSErr )
  591. PMgrStateQRemove                (PMgrQueueElement *        theElement)                            TWOWORDINLINE(0x7023, 0xA09E);
  592.  
  593.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  594.                                                                                             #pragma parameter __D0 UpdateSystemActivity(__D0)
  595.                                                                                             #endif
  596. EXTERN_API( OSErr )
  597. UpdateSystemActivity            (UInt8                     activity)                            FOURWORDINLINE(0x4840, 0x303C, 0x0024, 0xA09E);
  598.  
  599.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  600.                                                                                             #pragma parameter __D0 DelaySystemIdle
  601.                                                                                             #endif
  602. EXTERN_API( OSErr )
  603. DelaySystemIdle                    (void)                                                        TWOWORDINLINE(0x7025, 0xA09E);
  604.  
  605.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  606.                                                                                             #pragma parameter __D0 GetStartupTimer(__A0)
  607.                                                                                             #endif
  608. EXTERN_API( OSErr )
  609. GetStartupTimer                    (StartupTime *            theTime)                            TWOWORDINLINE(0x7026, 0xA09E);
  610.  
  611.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  612.                                                                                             #pragma parameter __D0 SetStartupTimer(__A0)
  613.                                                                                             #endif
  614. EXTERN_API( OSErr )
  615. SetStartupTimer                    (StartupTime *            theTime)                            TWOWORDINLINE(0x7027, 0xA09E);
  616.  
  617.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  618.                                                                                             #pragma parameter __D0 GetLastActivity(__A0)
  619.                                                                                             #endif
  620. EXTERN_API( OSErr )
  621. GetLastActivity                    (ActivityInfo *            theActivity)                        TWOWORDINLINE(0x7028, 0xA09E);
  622.  
  623.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  624.                                                                                             #pragma parameter __D0 GetSoundMixerState(__A0)
  625.                                                                                             #endif
  626. EXTERN_API( OSErr )
  627. GetSoundMixerState                (SoundMixerByte *        theSoundMixerByte)                    TWOWORDINLINE(0x7029, 0xA09E);
  628.  
  629.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  630.                                                                                             #pragma parameter __D0 SetSoundMixerState(__A0)
  631.                                                                                             #endif
  632. EXTERN_API( OSErr )
  633. SetSoundMixerState                (SoundMixerByte *        theSoundMixerByte)                    TWOWORDINLINE(0x702A, 0xA09E);
  634.  
  635.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  636.                                                                                             #pragma parameter __D0 GetDimSuspendState
  637.                                                                                             #endif
  638. EXTERN_API( Boolean )
  639. GetDimSuspendState                (void)                                                        TWOWORDINLINE(0x702B, 0xA09E);
  640.  
  641.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  642.                                                                                             #pragma parameter SetDimSuspendState(__D0)
  643.                                                                                             #endif
  644. EXTERN_API( void )
  645. SetDimSuspendState                (Boolean                 dimSuspendState)                    FOURWORDINLINE(0x4840, 0x303C, 0x002C, 0xA09E);
  646.  
  647. enum { uppSleepQProcInfo = 0x00131832 };                         /* register 4_bytes:D0 Func(4_bytes:D0, 4_bytes:A0) */
  648. enum { uppHDSpindownProcInfo = 0x000000C0 };                     /* pascal no_return_value Func(4_bytes) */
  649. enum { uppPMgrStateChangeProcInfo = 0x000003C0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes) */
  650. #define NewSleepQProc(userRoutine)                                 (SleepQUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSleepQProcInfo, GetCurrentArchitecture())
  651. #define NewHDSpindownProc(userRoutine)                             (HDSpindownUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHDSpindownProcInfo, GetCurrentArchitecture())
  652. #define NewPMgrStateChangeProc(userRoutine)                     (PMgrStateChangeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPMgrStateChangeProcInfo, GetCurrentArchitecture())
  653. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  654.     #pragma parameter __D0 CallSleepQProc(__A1, __D0, __A0)
  655.     long CallSleepQProc(SleepQUPP routine, long message, SleepQRecPtr qRecPtr) = 0x4E91;
  656. #else
  657.     #define CallSleepQProc(userRoutine, message, qRecPtr)         CALL_TWO_PARAMETER_UPP((userRoutine), uppSleepQProcInfo, (message), (qRecPtr))
  658. #endif
  659. #define CallHDSpindownProc(userRoutine, theElement)             CALL_ONE_PARAMETER_UPP((userRoutine), uppHDSpindownProcInfo, (theElement))
  660. #define CallPMgrStateChangeProc(userRoutine, theElement, stateBits)  CALL_TWO_PARAMETER_UPP((userRoutine), uppPMgrStateChangeProcInfo, (theElement), (stateBits))
  661.  
  662.  
  663. #if PRAGMA_STRUCT_ALIGN
  664.     #pragma options align=reset
  665. #elif PRAGMA_STRUCT_PACKPUSH
  666.     #pragma pack(pop)
  667. #elif PRAGMA_STRUCT_PACK
  668.     #pragma pack()
  669. #endif
  670.  
  671. #ifdef PRAGMA_IMPORT_OFF
  672. #pragma import off
  673. #elif PRAGMA_IMPORT
  674. #pragma import reset
  675. #endif
  676.  
  677. #ifdef __cplusplus
  678. }
  679. #endif
  680.  
  681. #endif /* __POWER__ */
  682.  
  683.